package edu.sctu.zcy.month201506.day20150609;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by user24 on 2015/6/9.
 */
public class TimeString {

    public void setTime(){

        String time = "2015-6-9 20:08";

        SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        Date date = null;

        try {

            date = simpleDateFormat1.parse(time);

        } catch (ParseException e) {

            e.printStackTrace();
        }


        System.out.println(simpleDateFormat1.format(date));
    }
}
